﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.EquipmentManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.EquipmentManagement.EquipmentSerialVMs
{
    public partial class EquipmentSerialTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._EquipmentSerial._Equipment")]
        public ExcelPropety Equipment_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.EquipmentId);
        [Display(Name = "_Model._EquipmentSerial._SerialName")]
        public ExcelPropety SerialName_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.SerialName);
        [Display(Name = "_Model._EquipmentSerial._Description")]
        public ExcelPropety Description_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.Description);
        [Display(Name = "_Model._EquipmentSerial._BaudRate")]
        public ExcelPropety BaudRate_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.BaudRate);
        [Display(Name = "_Model._EquipmentSerial._DataLength")]
        public ExcelPropety DataLength_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.DataLength);
        [Display(Name = "_Model._EquipmentSerial._StopBit")]
        public ExcelPropety StopBit_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.StopBit);
        [Display(Name = "_Model._EquipmentSerial._Parity")]
        public ExcelPropety Parity_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.Parity);
        [Display(Name = "_Model._EquipmentSerial._Threshold")]
        public ExcelPropety Threshold_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.Threshold);
        [Display(Name = "_Model._EquipmentSerial._Active")]
        public ExcelPropety Active_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.Active);
        [Display(Name = "_Model._EquipmentSerial._TagId")]
        public ExcelPropety TagId_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.TagId);
        [Display(Name = "_Model._EquipmentSerial._TagName")]
        public ExcelPropety TagName_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.TagName);
        [Display(Name = "_Model._EquipmentSerial._GlobalPushlish")]
        public ExcelPropety GlobalPushlish_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.GlobalPushlish);
        [Display(Name = "_Model._EquipmentSerial._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.CreateTime, true);
        [Display(Name = "_Model._EquipmentSerial._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.UpdateTime, true);
        [Display(Name = "_Model._EquipmentSerial._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.CreateBy);
        [Display(Name = "_Model._EquipmentSerial._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.UpdateBy);
        [Display(Name = "_Model._EquipmentSerial._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.IsValid);
        [Display(Name = "_Model._EquipmentSerial._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<EquipmentSerial>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Equipment_Excel.DataType = ColumnDataType.ComboBox;
            Equipment_Excel.ListItems = DC.Set<Equipment>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class EquipmentSerialImportVM : BaseImportVM<EquipmentSerialTemplateVM, EquipmentSerial>
    {
            //import

    }

}